# -*- encoding:utf-8 -*-
'''
	pipelinescsv.py
	======================
	@descript: 
	@copyright:chinasoft
	@author:guoxiaofei
	@date: 2021-01-27 08:47
	@version:v1.0
'''
import csv
class Pipelinecsv(object):
    def process_item(self, item, spider):
        with open('output/data.csv', 'a+',encoding='utf-8') as file:
            writer = csv.writer(file)
            for i in range(1,len(item['videoname'])):
                line = [item['videoname'][i], item['videourl'][i], item['videoimage'][i]]
                writer.writerow(line)

        return item